from time import sleep
from unittest import TestCase

from selenium import webdriver

from po_study.po.LoginPage import LoginPage
from po_study.utils.Config import Config
from po_study.utils.Logger import Logger

logger = Logger('TestEshop').getlog()

class TestEshopLogin(TestCase):
    file = './config/config.ini'
    config = Config(file)

    def test_eshop_login(self):
        self.driver = webdriver.Chrome(self.config.get_value(self.file,'system','driver'))
        login = LoginPage(self.driver)
        login.open(self.config.get_value(self.file,'system','url'))
        login.input_username()
        login.input_password()
        login.click_login_button()
        sleep(5)
